/************** O T T R   C O P Y R I G H T   N O T I C E **************
 **                                                                   **
 ** © 2013 OTTR, Inc.  All rights reserved.                           **
 **                                                                   ** 
 *************** O T T R   C O P Y R I G H T   N O T I C E *************/

package org.papillion39.sechelper.application.business.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.time.LocalDate;

/**
 *
 * @author Jonathan Paz <jonathan.paz@ottr.com>
 */
public class Address implements Serializable {
    private int id;
    private String addressType;
    private String addressLine1;
    private String addressLine2;
    private String addressLine3;
    private String city;
    private String state;
    private String zipCode;
    private String county;
    private String country;
    private LocalDate addressEffective;
    private boolean preferred;
    private final PropertyChangeSupport support = new PropertyChangeSupport(this);

    public Address() {
    }

    public Address(int id, String addressType, String addressLine1, String addressLine2, String addressLine3, String city, String state, String zipCode, String county, String country, LocalDate addressEffective, boolean preferred) {
        this.id = id;
        this.addressType = addressType;
        this.addressLine1 = addressLine1;
        this.addressLine2 = addressLine2;
        this.addressLine3 = addressLine3;
        this.city = city;
        this.state = state;
        this.zipCode = zipCode;
        this.county = county;
        this.country = country;
        this.addressEffective = addressEffective;
        this.preferred = preferred;
    }

    public int getId() {
        return id;
    }

    public String getAddressType() {
        return addressType;
    }

    public void setAddressType(String addressType) {
        String oldAddressType = this.addressType;
        this.addressType = addressType;
        support.firePropertyChange("addressType", oldAddressType, addressType);
    }

    public String getAddressLine1() {
        return addressLine1;
    }

    public void setAddressLine1(String addressLine1) {
        String oldAddressLine1 = this.addressLine1;
        this.addressLine1 = addressLine1;
        support.firePropertyChange("addressLine1", oldAddressLine1, addressLine1);
    }

    public String getAddressLine2() {
        return addressLine2;
    }

    public void setAddressLine2(String addressLine2) {
        String oldAddressLine2 = this.addressLine2;
        this.addressLine2 = addressLine2;
        support.firePropertyChange("addressLine2", oldAddressLine2, addressLine2);
    }

    public String getAddressLine3() {
        return addressLine3;
    }

    public void setAddressLine3(String addressLine3) {
        String oldAddressLine3 = this.addressLine3;
        this.addressLine3 = addressLine3;
        support.firePropertyChange("addressLine3", oldAddressLine3, addressLine3);
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        String oldcity = this.city;
        this.city = city;
        support.firePropertyChange("city", oldcity, city);
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        String oldstate = this.state;
        this.state = state;
        support.firePropertyChange("state", oldstate, state);
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        String oldzipCode = this.zipCode;
        this.zipCode = zipCode;
        support.firePropertyChange("zipCode", oldzipCode, zipCode);
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        String oldcounty = this.county;
        this.county = county;
        support.firePropertyChange("county", oldcounty, county);
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        String oldcountry = this.country;
        this.country = country;
        support.firePropertyChange("country", oldcountry, country);
    }

    public LocalDate getAddressEffective() {
        return addressEffective;
    }

    public void setAddressEffective(LocalDate addressEffective) {
        LocalDate oldaddressEffective = this.addressEffective;
        this.addressEffective = addressEffective;
        support.firePropertyChange("addressEffective", oldaddressEffective, addressEffective);
    }

    public boolean isPreferred() {
        return preferred;
    }

    public void setPreferred(boolean preferred) {
        boolean oldpreferred = this.preferred;
        this.preferred = preferred;
        support.firePropertyChange("preferred", oldpreferred, preferred);
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        support.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        support.removePropertyChangeListener(listener);
    }

    public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
        support.addPropertyChangeListener(propertyName, listener);
    }

    public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
        support.removePropertyChangeListener(propertyName, listener);
    }
}
